//package com.community.backend.controller;
//
//import com.community.backend.properties.BaiduAIProperties;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//@Component
//@Slf4j
//public class AIModelInvoker {
//    @Autowired
//    private BaiduAIProperties baiduAIProperties;
//
//    public String qianfanInvoker(String prompt){
//        Qianfan qianfan = new Qianfan(Auth.TYPE_OAUTH, baiduAIProperties.getAccessKey(), baiduAIProperties.getSecretKey());
//        ChatResponse response = qianfan.chatCompletion()
//                .model(baiduAIProperties.getQianfanModel())
//                .addMessage("user", prompt)
//                .temperature(0.7)
//                .maxOutputTokens(2000)
//                .execute();
//        String result = response.getResult();
//
//        return result;
//    }
//}